<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表属性列表</title>
<#include "/view/admin/headList.html"/>
    <script type="text/javascript">

        $(function() {
            //初始化
        });
    </script>
</head>
<body>



<div class="table-class">
    <div class="panel panel-default" style="margin: 10px 10px 10px;">
     <div class="panel-body">
        <form class="bs-example bs-example-form" role="form">

            <div class="input-group">
                <span class="input-group-addon">属性名</span>
                <input type="text" id="name" class="form-control" value="${entity.name!}" placeholder="请输入属性名">
            </div>
                <span class="bank-label">&nbsp;</span>

            <div class="input-group">
                <span class="input-group-addon">表名</span>
                <select id="tableId" name="tableId"
                        class="form-control selectpicker"   data-live-search="true"
                >
                    <option value="">请选择表名</option>
                            <#list listTableId as lv>
                                <option value="${lv.value!}"
                                <#if entity.tableId??&&entity.tableId == lv.value >
                                    selected="selected"
                                </#if>
                                >${lv.name!}</option>
                            </#list>




                </select>

            </div>
                <span class="bank-label">&nbsp;</span>


            <div class="input-group">
                <span class="input-group-addon">java属性类型</span>
                <select id="columntype" name="columntype"
                        class="form-control"
                >
                    <option value="">请选择java属性类型</option>
                                <option value="1" <#if entity.columntype??&&1 == entity.columntype>selected="selected"</#if>>java.lang.String</option>

                                <option value="2" <#if entity.columntype??&&2 == entity.columntype>selected="selected"</#if>>java.lang.Integer</option>

                                <option value="3" <#if entity.columntype??&&3 == entity.columntype>selected="selected"</#if>>java.util.Date</option>

                                <option value="4" <#if entity.columntype??&&4 == entity.columntype>selected="selected"</#if>>java.math.BigDecimal</option>


                </select>

            </div>
                <span class="bank-label">&nbsp;</span>


            <div class="input-group">
                <span class="input-group-addon">长度</span>
                <input type="text" id="length" class="form-control" value="${entity.length!}" placeholder="请输入长度">
            </div>
                <span class="bank-label">&nbsp;</span>

            <div class="input-group">
                <span class="input-group-addon">默认值</span>
                <input type="text" id="defalt" class="form-control" value="${entity.defalt!}" placeholder="请输入默认值">
            </div>
                <span class="bank-label">&nbsp;</span>

            <div class="input-group">
                <span class="input-group-addon">中文解释</span>
                <input type="text" id="describe" class="form-control" value="${entity.describe!}" placeholder="请输入中文解释">
            </div>
                <span class="bank-label">&nbsp;</span>

            <div class="input-group">
                <span class="input-group-addon">是否主键</span>
                <input type="text" id="isprimary" class="form-control" value="${entity.isprimary!}" placeholder="请输入是否主键">
            </div>
                <span class="bank-label">&nbsp;</span>

                <div class="input-group">
                    <span class="input-group-addon">开始创建时间</span>
                    <input type="text" id="createtimeStart" class="form-control isdatetimepicker" value="<#if (entity.createtimeStart)?? >${entity.createtimeStart?string('yyyy-MM-dd HH:mm:ss')}</#if>" id="createtimeStart" name="createtimeStart" data-date-format="yyyy-mm-dd hh:ii:ss">
                </div>
                <span class="bank-label">&nbsp;</span>
                <div class="input-group">
                    <span class="input-group-addon">结束创建时间</span>
                    <input type="text" id="createtimeEnd" class="form-control isdatetimepicker" value="<#if (entity.createtimeEnd)?? >${entity.createtimeEnd?string('yyyy-MM-dd HH:mm:ss')}</#if>" id="createtimeEnd" name="createtimeEnd" data-date-format="yyyy-mm-dd hh:ii:ss">
                </div>
                <span class="bank-label">&nbsp;</span>

                <div class="input-group">
                    <span class="input-group-addon">开始最后更新时间</span>
                    <input type="text" id="updatetimeStart" class="form-control isdatetimepicker" value="<#if (entity.updatetimeStart)?? >${entity.updatetimeStart?string('yyyy-MM-dd HH:mm:ss')}</#if>" id="updatetimeStart" name="updatetimeStart" data-date-format="yyyy-mm-dd hh:ii:ss">
                </div>
                <span class="bank-label">&nbsp;</span>
                <div class="input-group">
                    <span class="input-group-addon">结束最后更新时间</span>
                    <input type="text" id="updatetimeEnd" class="form-control isdatetimepicker" value="<#if (entity.updatetimeEnd)?? >${entity.updatetimeEnd?string('yyyy-MM-dd HH:mm:ss')}</#if>" id="updatetimeEnd" name="updatetimeEnd" data-date-format="yyyy-mm-dd hh:ii:ss">
                </div>
                <span class="bank-label">&nbsp;</span>


            <div class="input-group" style="text-align: right;">
                <a class="btn btn-info"  href="javascript:query('${base}/xycolumn/list.do')"><span class="glyphicon glyphicon-search"></span> 查找</a>

            </div>
        </form>
     </div>
    </div>


    <table class="table table-hover table-list table-bordered">
        <thead>
        <tr>
            <td class="table-head-btn">
                <div style="text-align:left;margin-left: 50px;">
                    <a href="${base}/xycolumn/add.do" class="btn btn-primary">新增</a>
                </div>
            </td>
        </tr>
        <tr class="table-head">
            <th>序号</th>
                <th class="label-hidden">主键</th>
                <th>属性名</th>
                <th>表名</th>
                <th>java属性类型</th>
                <th>长度</th>
                <th>默认值</th>
                <th>中文解释</th>
                <th>是否主键</th>
                <th>创建时间</th>
                <th>最后更新时间</th>

            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <#list pagination.list as c>
            <tr>
                <td>${(pagination.pageNo-1)*pagination.pageSize+1+c_index}</td>
                        <td class="label-hidden">${c.columnId!}</td>
                            <td>${c.name!}</td>

                        <td> 
                            <#if c.tableId??>
                                    <#list listTableId as lv>
                                        <#if lv.value??&&c.tableId == lv.value >
                                        ${lv.name!}
                                        </#if>
                                    </#list>

                            </#if>

                        </td>
                        <td> 

                            <#if c.columntype??>
                                        <#if c.columntype==1>java.lang.String
                                        <#elseif c.columntype==2>java.lang.Integer
                                        <#elseif c.columntype==3>java.util.Date
                                        <#elseif c.columntype==4>java.math.BigDecimal
                                        </#if>

                            </#if>
                        </td>
                            <td>${c.length!}</td>

                            <td>${c.defalt!}</td>

                            <td>${c.describe!}</td>

                            <td>${c.isprimary!}</td>

                        <td><#if c.createtime?? >${c.createtime?string('yyyy-MM-dd HH:mm:ss')}</#if></td>
                        <td><#if c.updatetime?? >${c.updatetime?string('yyyy-MM-dd HH:mm:ss')}</#if></td>

                <td>
                    <a href="${base}/xycolumn/detail.do?columnId=${c.columnId!}" class="btn btn-primary">详情</a>
                    <a href="${base}/xycolumn/add.do?columnId=${c.columnId!}" class="btn btn-primary">修改</a>
                    <a href="javascript:checkDelete('${base}/xycolumn/delete.do?columnId=${c.columnId!}')" class="btn btn-primary">删除</a>
                </td>
            </tr>









        </tbody>
    </table>


</div>
<script>

    function queryCondition(){
        var href="";
            href+='name='+$('#name').val();
                href+='&'
            href+='tableId='+$('#tableId').val();
                href+='&'
            href+='columntype='+$('#columntype').val();
                href+='&'
            href+='length='+$('#length').val();
                href+='&'
            href+='defalt='+$('#defalt').val();
                href+='&'
            href+='describe='+$('#describe').val();
                href+='&'
            href+='isprimary='+$('#isprimary').val();
                href+='&'
            href+='createtimeStart='+$('#createtimeStart').val()+"&";
            href+='createtimeEnd='+$('#createtimeEnd').val();
                href+='&'
            href+='updatetimeStart='+$('#updatetimeStart').val();
            href+='updatetimeEnd='+$('#updatetimeEnd').val();
                
        return href;
    }

</script>

</body>
</html>
